package com.itmk.config.web.material_info.controller;

import com.itmk.config.web.material_info.entity.MaterialInfo;
import com.itmk.config.web.material_info.service.MaterialInfoService;
import com.itmk.utils.ResultUtils;
import com.itmk.utils.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/materialInfo")
public class MaterialInfoController {

    @Autowired
    private MaterialInfoService materialInfoService;

    public ResultVO add(@RequestBody MaterialInfo materialInfo){

        if (materialInfoService.save(materialInfo)){
            return ResultUtils.success("新增成功");
        }
        return ResultUtils.error("新增失败");

    }
}
